<template>
  <form-item :form-datas = "formDatas" :form-item = "field" :parent-comp-type = "parentCompType"
  >
    <el-switch
        :active-color = "field.preps['activeColor']"
        :active-icon = "field.preps['activeIcon']"
        :active-text = "field.preps['activeText']"
        :active-value = "field.preps['activeValue']"
        :before-change = "field.preps['beforeChange']"
        :border-color = "field.preps['borderColor']"
        :disabled = "field.preps['disabled']"
        :inactive-color = "field.preps['inactiveColor']"
        :inactive-icon = "field.preps['inactiveIcon']"
        :inactive-text = "field.preps['inactiveText']"
        :inactive-value = "field.preps['inactiveValue']"
        :inline-prompt = "field.preps['inlinePrompt']"
        :loading = "field.preps['loading']"
        :name = "field.preps['name']"
        :size = "field.preps['size']"
        :validate-event = "field.preps['validateEvent']"
        :width = "field.preps['width']"
        v-model = "starHorseDynamicForm[field.preps['name']]"
    />

  </form-item>
</template>

<script>
import FormItem from "./form-item";

export default {
  name: "switch-item",
  components: {FormItem},
  props: {
    parentCompType: {type: Object},
    starHorseDynamicForm: {type: Object},
    field: {
      type: Object
    },
    formDatas: {type: Object}
  },
  data() {
    let formItem = {label: "input", required: false};
    return {
      formItem,
      dataField: ""
    }
  },
  methods: {
    selectItem(data) {
      let _this = this;
      _this.$emit("selectItem", data, _this.parentCompType);
    }
  }
}
</script>

<style scoped>

</style>